﻿@model SportsStore.WebUI.Models.ProductEditViewModel

@{
    ViewBag.Title = "Admin: Edit " + @Model.Name;
    Layout = "~/Views/Shared/AdminLayout.cshtml";
}

<h1>Edit @Model.Name</h1>

@using (Html.BeginForm("EditProduct", "Admin"))
{
    //@Html.EditorForModel()
    
    <div class="editor-field"> @Html.HiddenFor(model => model.ProductID)</div>    
    <div class="editor-label"> @Html.LabelFor(model => model.Name)</div>    <div class="editor-field"> @Html.TextBoxFor(model => model.Name)</div>    <div class="editor-label"> @Html.LabelFor(model => model.Description)</div>
    <div class="editor-field"> @Html.TextAreaFor(model => model.Description)</div>
    <div class="editor-label"> @Html.LabelFor(model => model.Price)</div>
    <div class="editor-field"> @Html.TextBoxFor(model => model.Price)</div>
    <div class="editor-label">@Html.LabelFor(model => model.SelectedCategoryID)</div>
    <div class="multi-line">  @Html.DropDownListFor(model => model.SelectedCategoryID,
            new SelectList(Model.Categories, "CategoryID", "Name"),"--Select Category--")</div>
    
    <div><input type="submit" value="Save" />
    @Html.ActionLink("Cancel and return to List", "Products")</div>
}
